package cn.wolfcode.controller;

import cn.wolfcode.domian.Result;
import cn.wolfcode.service.empService;
import cn.wolfcode.utils.ossUtlis;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RestController
@Slf4j
public class uploadController {
    @Autowired
    private ossUtlis ossUtlis;

    @PostMapping("/upload")
    public Result upload(MultipartFile image) throws IOException {
        log.info("上传文件");
        return Result.success(ossUtlis.udload(image)) ;
    }
}
